/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package backupit;

import backupit.gui.BackupListFrame;
import backupit.gui.control.BackupWriterManagerController;
import backupit.gui.BackupWriterManagerDialog;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

/**
 *
 * @author dbotelho
 */
public class GUILauncher implements Runnable {
    
    private Settings settings;
    private BackupListFrame mainFrame;
    private BackupWriterManagerController backupManager;
    
    public GUILauncher(Settings settings){
        this.settings = settings;
    }

    public void run() {
        this.backupManager = new BackupWriterManagerController(this);
        this.setMainFrame(new BackupListFrame(this));
        this.getMainFrame().setVisible(true);
    }
    
    public void updateUI(String looknFeel) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException{
        UIManager.setLookAndFeel(looknFeel);
        mainFrame.updateUI(looknFeel);
        backupManager.updateUI(looknFeel);
        //backupManager.getBackupManagerGUI().repaint();
    }

    public Settings getSettings() {
        return settings;
    }

    public void setSettings(Settings settings) {
        this.settings = settings;
    }

    public BackupListFrame getMainFrame() {
        return mainFrame;
    }

    public void setMainFrame(BackupListFrame mainFrame) {
        this.mainFrame = mainFrame;
    }

    public BackupWriterManagerController getBackupManager() {
        return backupManager;
    }

    
}
